package cloud.alibaba.study.controller;

import java.math.BigDecimal;

import javax.annotation.Resource;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import cloud.alibaba.study.entity.base.ResponseVo;
import cloud.alibaba.study.service.IAccountService;

@RestController
@RequestMapping("account")
public class AccountController {
	 @Resource
	 private  IAccountService accountService;

	    /**
	     * 扣减账户余额
	     */
	    @RequestMapping("/decrease")
	    public ResponseVo decrease(@RequestParam("userId") Long userId, @RequestParam("money") BigDecimal money){
	        accountService.decrease(userId,money);
	        return ResponseVo.successMsg("扣减账户余额成功！");
	    }

}
